home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93b.txt / 000033_icon-group-sender _Tue Apr 27 01:52:23 1993.msg < prev    next >
Internet Message Format  |  1993-06-16  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 28 Apr 1993 04:50:04 MST
  2. Date: 27 Apr 93 01:52:23 GMT
  3. From: elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!uwm.edu!linac!uchinews!ellis!goer@ames.arc.nasa.gov  (Richard L. Goerwitz)
  4. Organization: University of Chicago
  5. Subject: Re: Help!
  6. Message-Id: <1993Apr27.015223.18496@midway.uchicago.edu>
  7. References: <Apr26.234849.37604@yuma.ACNS.ColoState.EDU>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. erholm@CS.ColoState.EDU (scott erholm) writes:
  14. >
  15. >In Pascal, I could pass values to and from procedures in this manner:
  16. >
  17. >Procedure P (VAR x, y, z : Integer; l, m : Real);
  18. >   (* procedure body *)
  19. >end;
  20. >
  21. >And the call to P would look like this:
  22. >
  23. >P (a, b, c, 10, 20);
  24. >
  25. >meaning that procedure P would get 10 and 20 for l and m, and would
  26. >pass the values of x, y, and z back to the calling program.
  27.  
  28. So-called "var" parameters in Pascal are a way of introducing side-
  29. effects.  These are not permitted in Icon per se.  One usually does
  30. not want or need them, although I have often wondered whether adding
  31. them would be difficult - if they were done precisely as in Pascal
  32. (i.e. not as in C, which might break Icon's type-safe scheme).
  33.  
  34. Show us what you want to do in Icon, and I'll bet someone here will
  35. gladly suggest how to do it.
  36.  
  37. The question is whether you should pass a structure, or whether you
  38. are approaching the whole problem in an "Iconish" fashion.  Be pretty
  39. specific, and I'm sure you'll get some cogent suggestions.
  40.  
  41. -- 
  42.  
  43.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  44.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  45.